#include <iostream>
#include <vector>
#include <unordered_map>

using namespace std;

class Solution
{
public:
    int longestSubsequence(vector<int> &arr, int difference)
    {
        unordered_map<int, int> dp;
        int max_len = 1;
        for (auto num : arr)
        {
            dp[num] = dp[num - difference] + 1;
            max_len = max(max_len, dp[num]);
        }
        return max_len;
    }
};

int main()
{
    cout << "Code1218" << endl;
    Solution s;
    return 0;
}